package bdz.projects.inl.vo
{
	import bdz.projects.inl.core.CoreVO;

	public class UserVO extends CoreVO
	{
		public var user_id:String;
		public var user_name:String;
		public var user_password:String;
		public var user_email:String;
		public var user_displayname:String;
		public var user_type:String;
		public var downloads:Array = new Array();
		public function UserVO(defXML:XML = null) {
			idField = "user_id";
			linkPairs = [
						{tree:"downloads", node:"inl_downloads", arr:"downloads", vo:DownloadVO}
						];
			if(defXML && defXML.name() != "inl_users"){
				defXML = defXML.inl_users[0];	
			}
			propList = ["user_id", "user_name", "user_password", "user_email", "user_displayname", "user_type"];
			super(defXML, null, "inl_users");
		}
		override protected function createPropertyAttributes():void{
			propAttributes = [
			{name:"user_name", type:"input", label:"Username"},
			{name:"user_password", type:"password", label:"Password"},
			{name:"user_email", type:"input", label:"Email"},
			{name:"user_displayname", type:"input", label:"Display Name"},
			{name:"user_type", type:"selection", option:"admin|standard", label:"Type", useoption:"combo"},
			{name:"downloads", type:"dependency_list", vo:DownloadVO, label:"Downloads", list:"link", labelField:"download_name", idField:"download_id"}
			];
		}
		
	}
}